package com.zr.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * 增加浏览次数的controller层
 * @author Administrator
 *
 */
import javax.servlet.http.HttpSession;

import com.zr.service.AddNumberService;
import com.zr.service.impl.AddNumberServiceImpl;
public class AddNumberController extends HttpServlet{

	AddNumberService ans = new AddNumberServiceImpl();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		
		int cid = Integer.parseInt(req.getParameter("number"));

		ans.setNumberById(cid);
		
	}
	
}
